/*************************************************************************
 *                                                                       *
 * This file is part of the FreeMAPs distribution.  For full copyright   *
 * information, see COPYRIGHT and COPYING.LESSER.                        *
 *                                                                       *
 * Author:           sqbang                                              *
 * Email:            sqbang@ustc.edu                                     *
 * Date:             2017.03.31                                          *
 *                                                                       *
 *************************************************************************/

namespace FreeMAPs
{

inline int
DatabaseBox::get_dim_val() const
{
    return d_data.d_dimension;
}


inline void
DatabaseBox::set_dim(
    const int dim)
{
    d_data.d_dimension = dim;
}


inline int&
DatabaseBox::lower(
    const int i)
{
    FREEMAPS_ASSERT ((i >= 0) && (i < get_dim_val()));
    return d_data.d_lo[i];
}


inline int&
DatabaseBox::upper(
    const int i)
{
    FREEMAPS_ASSERT((i >= 0) && (i < get_dim_val()));
    return d_data.d_hi[i];
}


inline int
DatabaseBox::lower(
    const int i) const
{
    FREEMAPS_ASSERT((i >= 0) && (i < get_dim_val()));
    return d_data.d_lo[i];
}


inline int
DatabaseBox::upper(
    const int i) const
{
    FREEMAPS_ASSERT((i >= 0) && (i < get_dim_val()));
    return d_data.d_hi[i];
}

}
